package com.bitao.system.controller.user;

import com.bitao.controller.BaseController;
import com.bitao.R;
import com.bitao.TableDataInfo;
import com.bitao.system.domain.user.dto.UserQueryDTO;
import com.bitao.system.domain.user.dto.UserUpdateDTO;
import com.bitao.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2025-06-03  15:49
 */
@RestController
@RequestMapping("/user")
public class UserController extends BaseController {

    @Autowired
    private IUserService userService;

    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO) {
        return getTableDataInfo(userService.list(userQueryDTO));
    }

    @PutMapping("/updateStatus")
    //todo 拉黑:限制用户的操作
    public R<Void> updateStatus(@RequestBody UserUpdateDTO userUpdateDTO) {
       return toR(userService.updateStatus(userUpdateDTO));
    }
}
